﻿using System;
using System.Linq;
using Microsoft.TeamFoundation.VersionControl.Client;
using System.Collections;

namespace TfsMerge.BO
{
    public class UIChangeset
    {
        public UIChangeset(Changeset changeset)
        {
            ChangesetId = changeset.ChangesetId;
            Comment = changeset.Comment;
            CreationDate = changeset.CreationDate;
            Owner = changeset.Owner;

            WorkItems = changeset.WorkItems.ToList();
            WorkItemsString = string.Join(",", changeset.WorkItems.Select(x => x.Id));
        }


        public int ChangesetId { get; private set; }

        public string Comment { get; private set; }

        public DateTime CreationDate { get; private set; }

        public string Owner { get; private set; }

        // WorkItems
        public string WorkItemsString { get; private set; }

        public IList WorkItems { get; private set; }
    }
}
